<template>
  <Person v-if="isShow" />
  <button @click="isShow = false">点我卸载Person组件</button>
</template>

<script setup lang="ts" name="App">
import { onMounted, ref } from "vue";
import Person from "./components/Person.vue";
let isShow = ref(true);

// 子组件会比父组件先挂载完毕 App组件最后挂载完毕
onMounted(() => {
  console.log("父-- 挂载完毕");
});
</script>
